import { instance } from "../utils/request";
const getPromotionsPagination = async (page:number,limit:number,key?:string) => {
	return await instance.get("/Promotions/Pagination", {page,limit,key});
};

const addPromotions = async (data:RequestCreatePromotionsDto) => {
	return await instance.post("/Promotions/Add", data);
};

const updatePromotions = async (data:RequestUpdatePromotionsDto) => {
	return await instance.post("/Promotions/Update", data);
};

const getPromotionsDetail = async (id:number) => {
	return await instance.get("/Promotions/Detail", { id  });
};

const deletePromotions = async (data:RequestIdPromotionsDto) => {
	return await instance.post("/Promotions/Delete", data);
};

const PromotionsApi = {
	getPromotionsPagination,
	addPromotions,
	updatePromotions,
	getPromotionsDetail,
	deletePromotions,
};

export default PromotionsApi
